#!/usr/bin/env python
# encoding: utf-8
"""
@author: LiuYuanQi
@time: 2018/8/19 17:32
@Desc：读取用户的电影数据和评分数据，组装起来。
"""
import pandas as pd
movies = pd.read_csv('..\data\movies.csv')
ratings = pd.read_csv('..\data\\ratings.csv')#这里注意如果路径的中文件名开头是r，要转义。
data = pd.merge(movies,ratings,on = 'movieId')#通过两数据框之间的movieId连接
data[['userId','rating','movieId','title']].sort_values('userId').to_csv('..\data\combiningData.csv',index=False)